package com.liaowei.exception;

import com.liaowei.common.ErrorCode;
import lombok.Getter;

@Getter
public class CustomerException extends RuntimeException{

    private int code;
    private String description;

    public CustomerException(ErrorCode errorCode){
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
        this.description = errorCode.getDescription();
    }

    public CustomerException(int code,String message) {
        super(message);
        this.code = code;
    }
}
